using System;
using ShaderCompiler.Core;

namespace TestShader
{
	public sealed class MainShader : ShaderI
	{
		[VSInput(VSInputTypes.Position, 0)]
		public Vector3 InPosition;
		[VSInput(VSInputTypes.Color, 0)]
		public Vector4 InColor;
		[VSInput(VSInputTypes.UV, 0)]
		public Vector2 InUV;
		
		[VSOutputPSInput(VSOutputPSInputTypes.Position, 0)]
		public Vector4 InOutPosition;
		[VSOutputPSInput(VSOutputPSInputTypes.InOut, 0)]
		public Vector4 InOutColor;
		[VSOutputPSInput(VSOutputPSInputTypes.InOut, 1)]
		public Vector2 InOutUV;
		
		[PSOutput(PSOutputTypes.Color, 0)]
		public Vector4 OutColor;
	
		public Texture2D MyTexture, MyTexture2;
		public Matrix4 Camera;
	
		[ShaderMethod(ShaderMethodTypes.VS)]
		public void VSMain()
		{
			InOutPosition = Camera.Multiply(new Vector4(InPosition, 1));
			InOutColor = InColor;
			InOutUV = InUV;
		}
		
		[ShaderMethod(ShaderMethodTypes.PS)]
		public void PSMain()
		{
			Vector4 vec = InOutPosition;
			
			Vector4 c = MyTexture.Sample(InOutUV);
			Vector4 c2 = MyTexture2.Sample(InOutUV);
			OutColor = c + c2;
		}
		
		public int Foo(int i)
		{
			return i;
		}
	}
}

